#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2024-7-3 18:56
# @Author  : jiaoxianzhong
# @File    : cache_helper.py
# @Software: PyCharm
from flask_caching import Cache

cache = Cache()


class CacheHelper:
    def __init__(self, app, config):
        cache.init_app(app, config)

    @staticmethod
    def get(key):
        return cache.get(key)

    @staticmethod
    def set(key, value, timeout=None):
        cache.set(key, value, timeout=timeout)

    @staticmethod
    def delete(key):
        cache.delete(key)
